package top.hzy520.web;

import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import top.hzy520.dept.entity.Dept;
import top.hzy520.user.entity.User;

/**
 * @Author: HouZeYu
 * @Description:
 * @Date: Created in 16:25 2018/7/25
 */

@Controller
public class WebController {
    @RequestMapping("/edit")
    public String edit(){return "edit";}
    @RequestMapping("/attend")
    public String attend(){return "attend";}
    @RequestMapping("/dept")
    public String dept(){return "admin/dept/dept";}
    @RequestMapping("/role")
    public String role(){return "admin/role/role";}
    @RequestMapping("/notice")
    public String notice(){return "notice";}
    @RequestMapping(value = "/login")
    public String login(){
        return "login";
    }
    @RequestMapping("/loginlog")
    public String loginLog(){return "admin/log/loginLog";}
    @RequestMapping("/online")
    public String online(){return "admin/online/online";}
    @RequestMapping("/operationlog")
    public String operationLog(){return "admin/log/operationlog";}
    @RequestMapping("/unauth")
    public String unauth(){
        return "error/unauth";
    }
    @RequestMapping("/main")
    public String main(Model model){
   User user= (User) SecurityUtils.getSubject().getSession().getAttribute("user");
        model.addAttribute("user",user);
        return "main";
    }
    @RequestMapping("/system/dept/selectDeptTree/")
    public String selectDeptTree(){
        return "admin/dept/tree";
    }
    @RequestMapping("/profile/edit")
    public String profileEdit(){
        return "admin/user/profile/edit";
    }
    @RequestMapping("/profile/avatar")
    public String profileAvatar(){
        return "admin/user/profile/avatar";
    }
    @RequestMapping("/noticeinfo")
    public String noticeInfo(){
      return "noticeInfo";
    }

}
